UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u6tcdIReNdY7fcPMa2eC/391eMLtu+1/6qPAaTx5WGc=' 
WHERE 
  key_id = '5f6e98a1488fb0fb1628d245063728c74fdecfe3b03750a50f0902d59a1c7c26' 
  AND (
    token = 'u6tcdIReNdY7fcPMa2eC/391eMLtu+1/6qPAaTx5WGc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049