UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VTIE7Qwm8pJYah+QpF5Rjt0iZyAXTC6bwYAM4V5ApZI=' 
WHERE 
  key_id = 'd9211b1d3d5aa1babcae1672ecbbc2cc2368ec3bf82626045b20b11c308152cd' 
  AND (
    token = 'VTIE7Qwm8pJYah+QpF5Rjt0iZyAXTC6bwYAM4V5ApZI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029