UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QMFjoDwcl5NPzuAbSl6807rcVC5xGGBZ3R8Xn80VuC8=' 
WHERE 
  key_id = 'b54416cab5ce2b7a121302754589cfd3092f95da2d53130198d70e9cfb97fa9d' 
  AND (
    token = 'QMFjoDwcl5NPzuAbSl6807rcVC5xGGBZ3R8Xn80VuC8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030