UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vsQjQ/XqDmlHbLlGmqpdZiFaYo4ZGtRwPrNPIF5ZlBo=' 
WHERE 
  key_id = '4eeccdc653234bd1990e2dc70a026d7faff6e3f6ae74a09bd6c8bc336c82f79f' 
  AND (
    token = 'vsQjQ/XqDmlHbLlGmqpdZiFaYo4ZGtRwPrNPIF5ZlBo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030