UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UwjAbIJq2/NUQs+VJyFwKwSrnx50Zc9HxedBVnsjQjs=' 
WHERE 
  key_id = 'b757e48625ea9fe315544c8a0c2ad2b5cd6a25e70740818e265799ab03d474c2' 
  AND (
    token = 'UwjAbIJq2/NUQs+VJyFwKwSrnx50Zc9HxedBVnsjQjs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022