UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zUKXKkozEPT5ZQR2/p/NBWk9bCM6vRotB6o/jthNWXI=' 
WHERE 
  key_id = '8d5b02f9b314e9bc9165500f7bd321b53acd10be16e53a255e5f1c5f0e82fcf8' 
  AND (
    token = 'zUKXKkozEPT5ZQR2/p/NBWk9bCM6vRotB6o/jthNWXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026