UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JOEvzY0qFBQYMTqlX9WbJXvE9+D28OsgKtfw+Yh4X9I=' 
WHERE 
  key_id = '156afc56434ffc7275a7efccbcbe236c0f562aaa3f10a78570f71efcc8f91b38' 
  AND (
    token = 'JOEvzY0qFBQYMTqlX9WbJXvE9+D28OsgKtfw+Yh4X9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035