UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HPUeIbUUVyFYD/Q7/nNHRix01cRA92SM+eQT/jMc2hA=' 
WHERE 
  key_id = '3c84a73209d46593369b0e5152b3cea6bda780428a6856b9dd5e85b10a9b9c23' 
  AND (
    token = 'HPUeIbUUVyFYD/Q7/nNHRix01cRA92SM+eQT/jMc2hA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037