UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E3bY43dm/uaAcv1VniFb5esaE9Da9c646JZJhUOyc4k=' 
WHERE 
  key_id = '3887c8141cd4af5cef92b57f5554bfe58320255dbf4a3f0bde842c2699b3559d' 
  AND (
    token = 'E3bY43dm/uaAcv1VniFb5esaE9Da9c646JZJhUOyc4k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018