UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j73qTynQCaMd+uvK/Vk2tQpfB78XRwEqkXW9uyR9dM0=' 
WHERE 
  key_id = '2ab18e045c0fd7e55bd7b9af5c391171e4ed480fcacec8a839cc060affb3a22e' 
  AND (
    token = 'j73qTynQCaMd+uvK/Vk2tQpfB78XRwEqkXW9uyR9dM0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050