UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tNdYLlWYrwpQV2iF/loQB52ABEBwZbP0MqR2ktdKjQQ=' 
WHERE 
  key_id = '6db3aa1acf2af29003ce7968d6fdb71de5e125c26b93e98e9e97bc177031250e' 
  AND (
    token = 'tNdYLlWYrwpQV2iF/loQB52ABEBwZbP0MqR2ktdKjQQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046