UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b4w8T/YlQEPhXiq/Zhjy5eJIeIIFwSeyD4KhGoCm9xg=' 
WHERE 
  key_id = 'd083c4499a01e45caf433e77e0fc98722098b3b5312e59c4096690e5cb7d6427' 
  AND (
    token = 'b4w8T/YlQEPhXiq/Zhjy5eJIeIIFwSeyD4KhGoCm9xg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034