UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LEtKrNoc/x8wMKyFNj7eRT8mF35wd6UvLJvlQ/DWgIM=' 
WHERE 
  key_id = 'ad0051fd18e00db6b984aebb71c4e68b557dbbaf932795b98a7bfef553684813' 
  AND (
    token = 'LEtKrNoc/x8wMKyFNj7eRT8mF35wd6UvLJvlQ/DWgIM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00071