UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UDUafezaqiC/nI7scvJMzqKTozhzAhBe9KDgW0bzRqI=' 
WHERE 
  key_id = '262677b054599db1297fc6d50901ac312a8a980dd6d27a1d6fa32a599341d250' 
  AND (
    token = 'UDUafezaqiC/nI7scvJMzqKTozhzAhBe9KDgW0bzRqI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029