UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CFOxlE3gZgxmu1JEfmjUlTUOVvNe/ILa/tVAG1SZy3s=' 
WHERE 
  key_id = '8ea8fe9fb305cedb34a65792025a618e26e4076fbd3ab01ab43bfac911e0f2cc' 
  AND (
    token = 'CFOxlE3gZgxmu1JEfmjUlTUOVvNe/ILa/tVAG1SZy3s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024