UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd+VsGCpKhvLD3gZxUIquXn53N1I/DUCDREQlYD+kiTU=' 
WHERE 
  key_id = '956e1b5e1c322802265da40ecb83a20217090f14b30bb15864d4ab70dbd844e4' 
  AND (
    token = 'd+VsGCpKhvLD3gZxUIquXn53N1I/DUCDREQlYD+kiTU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027