UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6T83VSBVYMokQSfzePfrzXFOfR9iNSN4GIO+GZRexHI=' 
WHERE 
  key_id = '2a2b3911f7d4190b2dc3058bb4647c8bae740d066e8ee24fb18c8f132686b8fb' 
  AND (
    token = '6T83VSBVYMokQSfzePfrzXFOfR9iNSN4GIO+GZRexHI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025