UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zkCwyfE3pljTlTbD6biJbf0kYsui3R3AnvbeB8W4Sk4=' 
WHERE 
  key_id = '2a6331da8fac2c067547753b52c77d8db90d9d1d6b48b4625649847549ab0fb3' 
  AND (
    token = 'zkCwyfE3pljTlTbD6biJbf0kYsui3R3AnvbeB8W4Sk4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051