UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g5C1G/wTkHI8iN9kClJ6tFUGcv6NG57IVJ9emBAAL1I=' 
WHERE 
  key_id = 'db7623b7598af16d2f26b80b8a70cbbe0ff9f4fde327039a6fad9ba3aa3c2330' 
  AND (
    token = 'g5C1G/wTkHI8iN9kClJ6tFUGcv6NG57IVJ9emBAAL1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052