UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vWnv1dZEoMfe0pGIQ3ywTGyjwEdNFj+kaOinaxbM8Kw=' 
WHERE 
  key_id = '09a65d167273d1ffe33ef88df93ccad7d0478b54e01af8b396e6af72e4e5e68b' 
  AND (
    token = 'vWnv1dZEoMfe0pGIQ3ywTGyjwEdNFj+kaOinaxbM8Kw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033