UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W2/4kyszKpgoiHqlUOhSw8MHMlJ061B9XbWhTYR/+54=' 
WHERE 
  key_id = '8c44174be1cca0ce2194ba595427a81ddf7930aa13f8a97f79362711db8e52c0' 
  AND (
    token = 'W2/4kyszKpgoiHqlUOhSw8MHMlJ061B9XbWhTYR/+54=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025