UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7m1v4NKopvGtQ85ojjPXoHwcvv+Dhpi1yqXBt192Tvo=' 
WHERE 
  key_id = '5e75e3dc300965607c7e8951e89fc16f07f7b27aac8c8342cfbfe3d300ed0e31' 
  AND (
    token = '7m1v4NKopvGtQ85ojjPXoHwcvv+Dhpi1yqXBt192Tvo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055