UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0i+7GXQE4U+kFMWC9OM+djvA/rnPZ+XpSUjrhRF5avQ=' 
WHERE 
  key_id = '93da6deeee35a7716802c491417856f2d7254e9d71571a16abb4c410c115eed0' 
  AND (
    token = '0i+7GXQE4U+kFMWC9OM+djvA/rnPZ+XpSUjrhRF5avQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039