UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L/PafuD9ugeZ/0Enndyq4ak3hSkX6ra3A9rgzbHeCgE=' 
WHERE 
  key_id = '400db53e51e9b0c1df9b972f22a5dab3390dafb3194fcbe22ee595fdf2d9f20e' 
  AND (
    token = 'L/PafuD9ugeZ/0Enndyq4ak3hSkX6ra3A9rgzbHeCgE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017