UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qo5G6kEYVrzhkD3t8pBkNXzcdyTaU8mxm9KyePatbOw=' 
WHERE 
  key_id = '73a62aff0013c1e3cb60f7492dc1b81c30e63a11016b8910a1c8ef8c796f4ebd' 
  AND (
    token = 'qo5G6kEYVrzhkD3t8pBkNXzcdyTaU8mxm9KyePatbOw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015