UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gkYv0U44aDsFWQN53U1QRUGe3IQiZ3Sd9xbX/KZzMVc=' 
WHERE 
  key_id = '44061803c50a825e777ca6ea5982cddb3ead19aad644ab4e19a8804ab64e124c' 
  AND (
    token = 'gkYv0U44aDsFWQN53U1QRUGe3IQiZ3Sd9xbX/KZzMVc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032