UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4LlIQ9unwRHZ7zxqDHU701l0/4V0ekZlRpcKAizboVs=' 
WHERE 
  key_id = '9f81d318589a1c4558354284de92f9edd7c6dcddae14d46582a4e6fdb617d74d' 
  AND (
    token = '4LlIQ9unwRHZ7zxqDHU701l0/4V0ekZlRpcKAizboVs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034