UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qlpJzJm6NnQuFEPZ8xTAguPk3bkjvo8A2SF8xbGgj4s=' 
WHERE 
  key_id = '184e3b99688c084a6080b347cc71bdf058a5ac80a2d14136ccb51bb671a2a531' 
  AND (
    token = 'qlpJzJm6NnQuFEPZ8xTAguPk3bkjvo8A2SF8xbGgj4s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021