UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4wixJwHvZFrC84gx+O7Prg34GUCwtixayZYSX+BmJ9I=' 
WHERE 
  key_id = 'edc6d7f00f5c3e51d7e214adbd38df49c8656e4320b169813189c70b71f1ad3f' 
  AND (
    token = '4wixJwHvZFrC84gx+O7Prg34GUCwtixayZYSX+BmJ9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051