UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PivHl09GMB8Umh5tGxronomj1QnirXnrTtL2pXSBJNo=' 
WHERE 
  key_id = '05c919f1bee5e4c8e34f4ef20371d0fcd430de798a4acb2884d5cf5277d299da' 
  AND (
    token = 'PivHl09GMB8Umh5tGxronomj1QnirXnrTtL2pXSBJNo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039