UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A256j6Ioko/qiWY32LxBCDB7joGgZoySUvyz/vfBbjg=' 
WHERE 
  key_id = '756c744b8c32e80d877fa5dd00b1584d578840365c4fbc29907c45f2f2123709' 
  AND (
    token = 'A256j6Ioko/qiWY32LxBCDB7joGgZoySUvyz/vfBbjg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030