UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e1MlXqezr1rFWPDkDDdsDuSFVElb1pdVDO1MV7DZdlE=' 
WHERE 
  key_id = '0f05057cd681f517bb77b567fc1413c9f75254a7290c36115bc61639bd5441bf' 
  AND (
    token = 'e1MlXqezr1rFWPDkDDdsDuSFVElb1pdVDO1MV7DZdlE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030